﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace CH.TestData.Common
{
    public class RandomHelper
    {
        private static readonly string randomString = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLMNBVCXZ0123456789";
        private static readonly string randomNumber = "0123456789";
        public static string GetRandomString(int length)
        {
    
            int count = randomString.Length - 1;
            string result = string.Empty;
            Random r = new Random(Guid.NewGuid().GetHashCode());
            for (int i = 0; i < length; i++)
            {
                result += randomString[r.Next(0, count)];
            }
            return result;
        }
        public static string GetRandomNumber(int length)
        {
      
            int count = randomNumber.Length - 1;
            string result = string.Empty;
            Random r = new Random(Guid.NewGuid().GetHashCode());
            for (int i = 0; i < length; i++)
            {
                result += randomNumber[r.Next(0, count)];
            }
            return result;
        }
    }
}
